//
//  QSureOrderCell.m
//  QoilPublic
//
//  Created by 杨凯 on 2017/4/26.
//  Copyright © 2017年 杨凯. All rights reserved.
//

#import "QSureOrderCell.h"
@interface QSureOrderCell ()
@property (weak, nonatomic) IBOutlet UILabel *subTitleLab;
@property (weak, nonatomic) IBOutlet UILabel *titleLab;
@end
@implementation QSureOrderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setIndexPath:(NSIndexPath *)indexPath{
    _indexPath = indexPath;
    if (_indexPath.row == 0) {
        _subTitleLab.textColor = [QColorUtility defaultRedColor];
    }else{
        _subTitleLab.textColor = [QColorUtility defaultDeepGrayColor];
    }
    if (_indexPath.row == 0) {
        _titleLab.text = @"加油金额";
    }else if (_indexPath.row == 1){
        _titleLab.text = @"国       标";
    }else if (_indexPath.row == 2){
        _titleLab.text = @"加油单价";
    }else if (_indexPath.row == 3){
        _titleLab.text = @"到达时间";
    }else if (_indexPath.row == 4){
        _titleLab.text = @"加油地点";
    }else if (_indexPath.row == 5){
        _titleLab.text = @"联系方式";
    }else if (_indexPath.row == 6){
        _titleLab.text = @"配送费用";
    }else if (_indexPath.row == 7){
        _titleLab.text = @"备注信息";
    }
}

- (void)setModel:(QSubmitOrderModel *)model{
    _model =model;
    if (_indexPath.row == 0) {
        //_subTitleLab.text =[NSString stringWithFormat:@"￥%@",_model.total];
        if ([_model.total isEqualToString:@""]) {
            _subTitleLab.text = @"服务未完成待结算";

        }else{
            _subTitleLab.text = [NSString stringWithFormat:@"预估加油金额%@元",_model.total];

        }
    }else if (_indexPath.row == 1){
        _subTitleLab.text = _model.oilType;
    }else if (_indexPath.row == 2){
        _subTitleLab.text = [NSString stringWithFormat:@"%@元/升",_model.price];
    }else if (_indexPath.row == 3){
        _subTitleLab.text = _model.time;
    }else if (_indexPath.row == 4){
        _subTitleLab.text = _model.address;
    }else if (_indexPath.row == 5){
        _subTitleLab.text = _model.tel;
    }else if (_indexPath.row == 6){
        _subTitleLab.text = [NSString stringWithFormat:@"%@",_model.costStr?_model.costStr:@"0"];
    }else if (_indexPath.row == 7){
        _subTitleLab.text = _model.remark;
    }
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
